﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HproseRpcTester.Utils
{
    /// <summary>
    /// 日志接口
    /// </summary>
    public interface ILog
    {
        /// <summary>
        /// 调试
        /// </summary>
        void Debug(string logStr);

        /// <summary>
        /// 信息
        /// </summary>
        void Info(string logStr);

        /// <summary>
        /// 警告
        /// </summary>
        void Warn(string logStr);

        /// <summary>
        /// 错误
        /// </summary>
        void Error(string logStr);
    }

    /// <summary>
    /// 控制台输出
    /// </summary>
    public class ConsoleLogger : ILog
    {
        public void Debug(string logStr)
        {
            Console.WriteLine(logStr);
        }

        public void Info(string logStr)
        {
            Console.WriteLine(logStr);
        }

        public void Warn(string logStr)
        {
            Console.WriteLine(logStr);
        }

        public void Error(string logStr)
        {
            Console.WriteLine(logStr);
        }
    }
}
